Note: this disassembly pertains to an already hacked binary!

80888E90	0
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
OR	A3,A1,R0
LW	V0,002C (A0)
LUI	AT,0001
ADDU	V0,V0,AT
LW	T0,06E0 (V0)	;T0=V0+6E0: p->type.controller
LW	A2,06E4 (V0)	;A2=V0+6E4: p->mail.controller
BEQL	T0,R0,8088901C	;return if type dialog isn't present
LW	RA,0014 (SP)
//80888EB8:
LBU	V0,0000 (A2)
ADDIU	AT,R0,0001
BNE	V0,AT,80888ED4
NOP
LH	V1,0022 (T0)	;V1=controller+22: cursor.row
BEQ	R0,R0,80888EE4
ADDIU	V1,V1,0002	;V1+=2	cursor.row+=2
//80888ED4:
BNE	V0,R0,80888EE4
ADDIU	V1,R0,0009
BEQ	R0,R0,80888EE4
OR	V1,R0,R0
//80888EE4:
LBU	V0,0001 (A2)
SUBU	A0,V1,V0
SLTI	AT,A0,FFFE
BEQ	AT,R0,80888F10
LUI	AT,3F80
MTC1	AT,F14
ADDIU	T6,V1,0002
SB	T6,0001 (A2)
SWC1	F14,0024 (A3)
BEQ	R0,R0,80888F30
LBU	V0,0001 (A2)
SLTI	AT,A0,0003
BNE	AT,R0,80888F30
LUI	AT,3F80
MTC1	AT,F14
ADDIU	T7,V1,FFFE
SB	T7,0001 (A2)
SWC1	F14,0024 (A3)
LBU	V0,0001 (A2)
SLL	T8,V0,0x4
ADDIU	T9,T8,FFE0
MTC1	T9,F4
LWC1	F6,001C (A3)
LUI	AT,3F80
CVT.S.W	F12,F4
MTC1	AT,F14
LUI	AT,8089
LWC1	F8,ABE4 (AT)
LUI	AT,4110
ADDIU	A0,A3,001C
SUB.S	F2,F12,F6
ABS.S	F0,F2
C.LT.S	F8,F0
NOP
BC1FL	80889018
SWC1	F12,001C (A3)
MTC1	AT,F10
MFC1	A1,F12
LUI	AT,40E0
C.LT.S	F10,F0
NOP
BC1FL	80888FC4
MTC1	AT,F4
LWC1	F0,0024 (A3)
LUI	AT,4080
MTC1	AT,F2
ADD.S	F16,F0,F0
SWC1	F16,0024 (A3)
LWC1	F18,0024 (A3)
C.LT.S	F2,F18
NOP
BC1F	80889004
NOP
BEQ	R0,R0,80889004
SWC1	F2,0024 (A3)
MTC1	AT,F4
LUI	AT,3F00
C.LT.S	F0,F4
NOP
BC1F	80889004
NOP
LWC1	F6,0024 (A3)
MTC1	AT,F8
NOP
MUL.S	F10,F6,F8
SWC1	F10,0024 (A3)
LWC1	F16,0024 (A3)
C.LT.S	F16,F14
NOP
BC1F	80889004
NOP
SWC1	F14,0024 (A3)
//80889004:
JAL	80099C18
LW	A2,0024 (A3)
BEQ	R0,R0,8088901C
LW	RA,0014 (SP)
//80889014:
SWC1	F12,001C (A3)
//80889018:	return
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

80889028	198	
LUI	AT,3F80
MTC1	AT,F12
LUI	AT,C170
LWC1	F2,0024 (A0)
LWC1	F4,001C (A0)
C.LT.S	F2,F12
SUB.S	F0,F4,F2
MTC1	R0,F2
BC1FL	80889058
C.LT.S	F2,F0
SWC1	F12,0024 (A0)
C.LT.S	F2,F0
NOP
BC1FL	80889100
SWC1	F2,001C (A0)
MTC1	AT,F6
SWC1	F0,001C (A0)
LUI	AT,41F8
C.LT.S	F6,F0
NOP
BC1FL	808890B4
MTC1	AT,F16
LWC1	F2,0024 (A0)
LUI	AT,4180
MTC1	AT,F0
ADD.S	F8,F2,F2
SWC1	F8,0024 (A0)
LWC1	F10,0024 (A0)
C.LT.S	F0,F10
NOP
BC1F	80889104
NOP
JR	RA
SWC1	F0,0024 (A0)
MTC1	AT,F16
LUI	AT,3F00
C.LT.S	F0,F16
NOP
BC1F	80889104
NOP
LWC1	F18,0024 (A0)
MTC1	AT,F4
NOP
MUL.S	F6,F18,F4
SWC1	F6,0024 (A0)
LWC1	F8,0024 (A0)
C.LT.S	F8,F12
NOP
BC1F	80889104
NOP
SWC1	F12,0024 (A0)
JR	RA
NOP
SWC1	F2,001C (A0)
SWC1	F2,0024 (A0)
JR	RA
NOP

8088910C	27C	
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
LW	T6,002C (A0)
LUI	T9,0001
ADDU	T9,T9,T6
LW	T9,06A8 (T9)
JALR	RA,T9
NOP
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

8088913C	2AC	
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
SW	A0,0018 (SP)
SW	A1,001C (SP)
JAL	80078DF4	;V0=buttons held on controller 1
NOP
ANDI	T6,V0,D000
BEQ	T6,R0,80889188
LW	T7,0018 (SP)
LW	T8,002C (T7)
LUI	T9,0001
LW	A0,001C (SP)
ADDU	T9,T9,T8
LW	T9,06B0 (T9)
ADDIU	A1,R0,0004
JALR	RA,T9
NOP
JAL	800D1A9C
ADDIU	A0,R0,005F
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

80889198	308	
ADDIU	SP,SP,FFE0
SW	RA,0014 (SP)
OR	A2,A0,R0
OR	A3,A1,R0
LW	V0,002C (A2)
LUI	AT,0001
ORI	AT,AT,0430
LUI	T9,0001
ADDU	T6,V0,AT
SW	T6,001C (SP)
SW	A2,0020 (SP)
ADDU	T9,T9,V0
LW	T9,06B0 (T9)
OR	A0,A3,R0
ADDIU	A1,R0,0004
JALR	RA,T9
NOP
LW	A0,0020 (SP)
LUI	T9,0001
LW	A1,001C (SP)
LW	T7,002C (A0)
ADDU	T9,T9,T7
LW	T9,06A4 (T9)
JALR	RA,T9
NOP
LW	RA,0014 (SP)
ADDIU	SP,SP,0020
JR	RA
NOP

8088920C	37C	
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
SW	A1,001C (SP)
LW	V0,002C (A0)
LUI	AT,0001
ORI	AT,AT,0358
ADDU	V0,V0,AT
LW	T6,0030 (V0)
ADDIU	AT,R0,0004
ADDIU	T7,R0,0003
BNE	T6,AT,80889270
LW	T8,001C (SP)
SW	T7,0004 (T8)
LW	T0,002C (A0)
LUI	T1,0001
ADDIU	T9,R0,0002
ADDU	T1,T1,T0
LW	T1,06E4 (T1)
ADDIU	A1,R0,000F
OR	A2,R0,R0
OR	A3,R0,R0
JAL	800C4D8C
SB	T9,0001 (T1)
BEQ	R0,R0,8088927C
LW	RA,0014 (SP)
JAL	80888E90
LW	A1,001C (SP)
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

80889288	3F8	
ADDIU	SP,SP,FFA0
SW	RA,0024 (SP)
SW	S0,0020 (SP)
SW	A0,0060 (SP)
SW	A1,0064 (SP)
LW	T6,0060 (SP)
LUI	AT,0001
LUI	S0,0001
LW	V0,002C (T6)
ORI	AT,AT,04C0
LW	A0,0064 (SP)
ADDU	S0,S0,V0
LW	S0,06E4 (S0)
ADDU	V1,V0,AT
JAL	80889028
SW	V1,005C (SP)
LW	V1,005C (SP)
LW	T7,0004 (V1)
BNEL	T7,R0,808894D4
LW	RA,0024 (SP)
LW	T8,0030 (V1)
ADDIU	AT,R0,0004
LW	T9,0060 (SP)
BNEL	T8,AT,808894D4
LW	RA,0024 (SP)
LW	T1,002C (T9)
LUI	T2,0001
LUI	T3,8013
ADDU	T2,T2,T1
LW	T2,06E0 (T2)	;T2=T2+6E0: p->type.controller
ADDIU	AT,R0,0001
SW	T2,0054 (SP)	;SP+54=T2: p->type.controller
LW	V0,003C (V1)
BNE	V0,R0,80889470
NOP
LW	T3,6FD8 (T3)
ADDIU	A1,S0,0008
ADDIU	T4,T3,03EE
SW	T4,0050 (SP)
JAL	8009C67C	;copy 0xA4 bytes from A1 to A0
LW	A0,00AC (S0)
ADDIU	A0,S0,009C
ADDIU	A1,R0,0010
JAL	8009C1C0	;V0=actual strlen
ADDIU	A2,R0,0020
LBU	T5,0007 (S0)
ADDIU	A0,SP,002C
ADDIU	A2,R0,0010
SUBU	T6,T5,V0
SW	T6,0048 (SP)
LW	A1,00AC (S0)
SW	V0,004C (SP)
JAL	800998C0	;copy A2 bytes from A1 to A0
ADDIU	A1,A1,0094
LW	T0,004C (SP)
ADDIU	A3,SP,002C
OR	V0,R0,R0
BLEZ	T0,80889390
ADDIU	A1,R0,0010	;A1=0x10: strlen
ADDIU	V1,R0,0020
LBU	T7,0000 (A3)
BNEL	V1,T7,80889394
LW	A0,00AC (S0)
ADDIU	V0,V0,0001
BNE	V0,T0,80889378
ADDIU	A3,A3,0001
LW	A0,00AC (S0)
SW	T0,004C (SP)
SW	A3,0040 (SP)
SW	V0,0044 (SP)
ADDIU	A2,R0,0020	;A2=0x20: ' '
JAL	8009992C	;memset(A0,A1,A2)
ADDIU	A0,A0,0094	;A0+=94: p->buffer
LW	V1,0048 (SP)
LW	V0,0044 (SP)
LW	A3,0040 (SP)
SLTI	AT,V1,0010
BEQ	AT,R0,808893DC
LW	T0,004C (SP)
LW	T8,00AC (S0)
OR	A1,A3,R0
SUBU	A2,T0,V0
ADDU	A0,T8,V1
JAL	800998C0	;copy A2 bytes from A1 to A0
ADDIU	A0,A0,0094
LW	V0,0050 (SP)
LBU	T9,002F (S0)
ADDIU	A2,R0,000A
ADDIU	A0,V0,0002
SB	T9,0000 (V0)
LW	A1,00AC (S0)
JAL	800998C0	;copy A2 bytes from A1 to A0
ADDIU	A1,A1,002A
LW	A0,0050 (SP)
LW	A1,00AC (S0)
ADDIU	A2,R0,0010
ADDIU	A0,A0,000C
JAL	800998C0	;copy A2 bytes from A1 to A0
ADDIU	A1,A1,0094
LW	T1,0064 (SP)
ADDIU	AT,R0,FFFF
LUI	A0,8013
LW	V0,003C (T1)
OR	A2,R0,R0
OR	A3,R0,R0
BEQ	V0,AT,8088945C
OR	A1,V0,R0
JAL	800B8B08
LW	A0,6FD8 (A0)
LW	A0,0060 (SP)
LUI	T3,0001
LW	T2,002C (A0)
ADDU	T3,T3,T2
LW	T3,06D0 (T3)
LW	T9,010C (T3)
JALR	RA,T9
NOP
LW	A0,0060 (SP)
JAL	80889198
LW	A1,0064 (SP)
BEQ	R0,R0,808894BC
LW	V0,0054 (SP)	;V0=SP+54: p->type.controller
BNE	V0,AT,808894B0
LW	A0,0060 (SP)
ADDIU	T4,S0,003C
SW	T4,0010 (SP)
LW	A0,0060 (SP)
ADDIU	A1,R0,000A
OR	A2,R0,R0
JAL	800C4DB0
OR	A3,R0,R0
ADDIU	T5,R0,0001
SB	T5,0000 (S0)
SB	R0,0002 (S0)
LW	T7,0064 (SP)
ADDIU	T6,R0,0001
BEQ	R0,R0,808894B8
SW	T6,0004 (T7)
//808894B0:
JAL	80889198
LW	A1,0064 (SP)
//808894B8:
LW	V0,0054 (SP)	;V0=SP+54: p->type.controller
BEQL	V0,R0,808894D4	;return if NULL pointer
LW	RA,0024 (SP)
//808894C4:	zero cursor position
SH	R0,0016 (V0)	;0->controller+16: cursor.pos
SH	R0,0020 (V0)	;0->controller+20: cursor.column
SH	R0,0022 (V0)	;0->controller+22: cursor.row
//808894D0:	return
LW	RA,0024 (SP)
LW	S0,0020 (SP)
ADDIU	SP,SP,0060
JR	RA
NOP

808894E4	654	
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
LW	T6,002C (A0)
LUI	T9,0001
ADDU	T9,T9,T6
LW	T9,06AC (T9)
JALR	RA,T9
NOP
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

80889514	684	
ADDIU	SP,SP,FFE0
SW	RA,0014 (SP)
LW	A1,002C (A0)
LUI	AT,0001
ORI	AT,AT,03E8
ADDU	A1,A1,AT
SW	A1,001C (SP)
SW	A0,0020 (SP)
LW	T9,000C (A1)
JALR	RA,T9
NOP
LW	A1,001C (SP)
LUI	T9,8089
LW	A0,0020 (SP)
LW	T6,0004 (A1)
SLL	T7,T6,0x2
ADDU	T9,T9,T7
LW	T9,ABA4 (T9)
JALR	RA,T9
NOP
LW	RA,0014 (SP)
ADDIU	SP,SP,0020
JR	RA
NOP

80889574	6E4	
ADDIU	SP,SP,FFC8
LUI	AT,4180
MTC1	AT,F12
SW	RA,0014 (SP)
SW	A0,0038 (SP)
SW	A1,003C (SP)
SW	A2,0040 (SP)
SW	A3,0044 (SP)
LW	T6,0048 (SP)
LW	T8,003C (SP)
LUI	AT,8000
LBU	T7,0031 (T6)	;T7=controller+31: stationary
MOV.S	F14,F12
LUI	A2,3F80
SW	T7,0034 (SP)
LW	T9,0028 (T8)
OR	A3,R0,R0
ADDU	T1,T9,AT
LUI	AT,8014
JAL	800E041C	;matrix conversion
SW	T1,58D0 (AT)
LWC1	F12,0040 (SP)
LWC1	F14,0044 (SP)
LUI	A2,430C
JAL	800E0314	;matrix conversion
ADDIU	A3,R0,0001
LW	A0,0038 (SP)
LUI	A2,DB06
LW	V1,0298 (A0)
ORI	A2,A2,0030
OR	V0,V1,R0
SW	A2,0000 (V0)
LW	T2,003C (SP)
ADDIU	V1,V1,0008
OR	A1,V1,R0
LW	T3,0028 (T2)
ADDIU	V1,V1,0008
LUI	T4,DA38
SW	T3,0004 (V0)
ORI	T4,T4,0003
SW	T4,0000 (A1)
SW	A1,001C (SP)
JAL	800E13C4	;V0=p->pulled matrix
SW	V1,0028 (SP)
LW	A1,001C (SP)
LW	V1,0028 (SP)
LUI	A2,DB06
ORI	A2,A2,0030
SW	V0,0004 (A1)
LUI	A3,DE00
OR	V0,V1,R0
LUI	T5,0C00
ADDIU	T5,T5,0120
SW	T5,0004 (V0)
SW	A3,0000 (V0)
ADDIU	V1,V1,0008
LW	T0,0048 (SP)
OR	V0,V1,R0
SW	A2,0000 (V0)
LW	T7,00BC (T0)
LW	T6,00B8 (T0)
ADDIU	V1,V1,0008
LUI	T1,8089
SUBU	T8,T6,T7
SW	T8,0004 (V0)
OR	V0,V1,R0
SW	A3,0000 (V0)
LW	A0,0034 (SP)	;A0=SP+34: stationary
LUI	T9,8089
ADDIU	T1,T1,A8A0
SLL	A0,A0,0x2
ADDU	T9,T9,A0
LW	T9,A7A0 (T9)	;T9=8088A8A0+offset: 
ADDIU	V1,V1,0008
ADDU	A1,A0,T1
SW	T9,0004 (V0)
LW	T2,0000 (A1)
LUI	T5,0C00
OR	V0,V1,R0
BEQ	T2,R0,8088970C
ADDIU	T5,T5,0158
SW	A2,0000 (V0)
LW	T3,003C (SP)
ADDIU	V1,V1,0008
LW	T4,0028 (T3)
SW	T4,0004 (V0)
OR	V0,V1,R0
SW	A3,0000 (V0)
SW	T5,0004 (V0)
ADDIU	V1,V1,0008
OR	V0,V1,R0
SW	A2,0000 (V0)
LW	T7,00BC (T0)
LW	T6,00B8 (T0)
ADDIU	V1,V1,0008
SUBU	T8,T6,T7
SW	T8,0004 (V0)
OR	V0,V1,R0
SW	A3,0000 (V0)
LW	T9,0000 (A1)
ADDIU	V1,V1,0008
SW	T9,0004 (V0)
OR	V0,V1,R0
SW	A2,0000 (V0)
LW	T1,003C (SP)
ADDIU	V1,V1,0008
LW	T2,0028 (T1)
SW	T2,0004 (V0)
LW	T3,0038 (SP)
SW	V1,0298 (T3)
LW	RA,0014 (SP)
ADDIU	SP,SP,0038
JR	RA
NOP

8088973C	8AC	
ADDIU	SP,SP,FFC8
LUI	AT,4180
MTC1	AT,F12
SW	RA,0014 (SP)
SW	A2,0040 (SP)
SW	A3,0044 (SP)
LW	T6,0000 (A1)
LUI	V0,0001
NOP
SW	T6,0034 (SP)
LW	T7,002C (A0)
LWC1	F16,0040 (SP)
ADDU	V0,V0,T7
LW	T9,06E4 (V0)
ADDIU	A0,T9,0032
JAL	800902C8	;V0=width of A1 chars at A0
LBU	A1,002F (T9)
ADDIU	V0,V0,0024
MOV.S	F14,F12
LUI	A2,3F80
OR	A3,R0,R0
MTC1	V0,F4
LUI	AT,C2C0
CVT.S.W	F6,F4
MTC1	AT,F4
LUI	AT,C298
OR	V0,R0,T9
ADD.S	F18,F6,F16
MTC1	AT,F10
ADD.S	F6,F18,F4
SWC1	F6,00B0 (V0)
LWC1	F8,0044 (SP)
SUB.S	F16,F8,F10
SWC1	F16,00B4 (V0)
JAL	800E041C	;matrix conversion
SW	V0,0030 (SP)
LW	V1,0030 (SP)
LUI	A2,430C
ADDIU	A3,R0,0001
LWC1	F12,00B0 (V1)
JAL	800E0314	;matrix conversion
LWC1	F14,00B4 (V1)
LW	A0,0034 (SP)
LW	V1,0298 (A0)
OR	A1,V1,R0
LUI	T0,DA38
ORI	T0,T0,0003
SW	T0,0000 (A1)
ADDIU	V1,V1,0008
SW	V1,0024 (SP)
JAL	800E13C4	;V0=pulled matrix
SW	A1,001C (SP)
LW	A1,001C (SP)
LW	V1,0024 (SP)
LUI	A0,DE00
SW	V0,0004 (A1)
OR	V0,V1,R0
LUI	T1,0C00
ADDIU	T1,T1,0120
SW	T1,0004 (V0)
SW	A0,0000 (V0)
ADDIU	V1,V1,0008
OR	V0,V1,R0
LUI	T2,0C00
ADDIU	T2,T2,01C0
SW	T2,0004 (V0)
SW	A0,0000 (V0)
ADDIU	V1,V1,0008
OR	V0,V1,R0
LUI	T3,0C00
ADDIU	T3,T3,0040
SW	T3,0004 (V0)
SW	A0,0000 (V0)
ADDIU	V1,V1,0008
LW	T4,0034 (SP)
SW	V1,0298 (T4)
LW	RA,0014 (SP)
JR	RA
ADDIU	SP,SP,0038

80889878	9E8	sets cursor position for letter editting
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
SW	A0,0018 (SP)
SW	A1,0010 (SP)
SW	A2,0020 (SP)
SW	A3,0024 (SP)
ADDIU	T1,R0,0001
LW	T6,0018 (SP)
LUI	AT,0001
LW	V0,002C (T6)
OR	A0,T6,R0
ADDU	V0,V0,AT
LW	T2,06E4 (V0)	;T2=V0+6E4: p->mail.controller
LW	T0,06E0 (V0)	;T0=V0+6E0: p->type.controller
LBU	A3,0002 (T2)
BNEL	T1,A3,808898D0
LH	A2,0016 (T0)	;A2=controller+16: cursor.pos
LW	A2,0020 (SP)
JAL	8088973C
LW	A3,0024 (SP)
BEQ	R0,R0,80889998
LW	RA,0014 (SP)
//808898D0:
LH	A1,0020 (T0)	;A1=controller+20: cursor.column
LW	A0,0024 (T0)	;A0=controller+24: p->text
ADDU	A0,A0,A2	;A0+=A2: text+cursor.pos = p->cursor
JAL	800902C8	;V0=width of A1 chars at A0
SUBU	A0,A0,A1	;A0-=A1: text + cursor.pos - cursor.column = p->start of cursor row
LBU	A0,0000 (T2)
ADDIU	AT,R0,0002
BNE	A0,R0,80889910
ADDIU	T3,V0,0040	;T3=V0+40: width of cursor row + margin
BNE	AT,A3,80889908
LBU	A1,0003 (T2)
JAL	800902C8	;V0=width of A1 chars at A0
ADDIU	A0,T2,0008
ADDU	T3,V0,T3
BEQ	R0,R0,80889944
OR	T8,R0,R0
BNEL	A0,T1,8088992C
LBU	A1,0007 (T2)
LH	T7,0022 (T0)
ADDIU	T8,T7,0001
SLL	T8,T8,0x4
BEQ	R0,R0,80889944
ADDIU	T8,T8,000C
JAL	800902C8	;V0=width of A1 chars at A0
LW	A0,0024 (T0)
ADDIU	T8,R0,00C0
SUBU	V0,T8,V0
ADDU	T3,V0,T3
ADDIU	T8,R0,0088
MTC1	T3,F4
LWC1	F18,0020 (SP)
CVT.S.W	F6,F4
LUI	AT,8089
LWC1	F8,ABE8 (AT)
ADD.S	F8,F6,F8
ADD.S	F10,F8,F18
MFC1	A2,F10
MTC1	T8,F4
LWC1	F16,0024 (SP)
LW	A1,0010 (SP)
CVT.S.W	F6,F4
LUI	AT,4210
MTC1	AT,F10
LW	T9,002C (T0)
LW	A0,0018 (SP)
SUB.S	F8,F16,F6
SUB.S	F18,F10,F8
JALR	RA,T9
MFC1	A3,F18
LW	RA,0014 (SP)
JR	RA
ADDIU	SP,SP,0018

808899A0
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP

808899E4	B54	displays postscript to screen
	accepts: A0=, A1=p->manager, A2=(float)xpos, A3=(float)ypos, SP+10=RGBA
ADDIU	SP,SP,FFC0
LUI	AT,3F80
MTC1	A2,F12		;F12=A2: xpos
SW	RA,003C (SP)
SW	A0,0040 (SP)
SW	A1,0044 (SP)	;SP+44=A1: p->manager
SW	A3,0010 (SP)	;SP+10=A3: ypos
LW	T0,0050 (SP)	;T0=[SP+10 f/caller]: RGBA
LBU	T1,0000 (T0)	;T1=rgba+0: red
SW	T1,0014 (SP)	;SP+14=T1: red
LBU	T1,0001 (T0)	;T1=rgba+1: green
SW	T1,0018 (SP)	;SP+18=T1: green
LBU	T1,0002 (T0)	;T1=rgba+2: blue
SW	T1,001C (SP)	;SP+1C=T1: blue
LBU	T1,0003 (T0)	;T1=rgba+3: alpha
SW	T1,0020 (SP)	;SP+20=T1: alpha
SW	R0,0024 (SP)	;SP+24=0
SW	R0,0028 (SP)	;SP+28=0
SW	AT,002C (SP)	;SP+2C=1.0
SW	AT,0030 (SP)	;SP+30=1.0
SW	R0,0034 (SP)	;SP+34=0
LW	T6,0040 (SP)
LUI	V0,0001
LW	T2,002C (T6)
ADDU	V0,V0,T2
LW	T2,06E4 (V0)
ADDIU	A0,T2,009C	;A0=T2+9C: p->text
JAL	800902C8	;V0=width of A1 chars at A0
LBU	A1,0007 (T2)	;A1=T2+7: strlen
ADDIU	T8,R0,00C0
SUBU	T9,T8,V0	;T9=C0-width: right-align position
MTC1	T9,F6
LW	A0,0044 (SP)	;A0=SP+44: p->manager
CVT.S.W	F10,F6	;F10=(float)difference in width
LBU	A2,0007 (T2)	;A2=T2+7: strlen
ADDIU	A1,T2,009C	;A1=T2+9C: p->text
ADD.S	F12,F12,F10	;F12+=F10: xpos+text offset: final xpos
MFC1	A3,F12		;A3=F12: xpos
JAL	80090E98	;print text to screen
OR	V0,R0,T2	;is this extroneous?
LW	RA,003C (SP)
JR	RA
ADDIU	SP,SP,0040

80889A90
NOP
NOP
NOP

80889A9C	C0C	display mail message body
	accepts: A0=, A1=p->manager, A2=p->text, A3=(float)xpos, SP+10=p->(float)ypos, SP+14=p->(float)xend, SP+18=p->(float)yend, SP+1C=RGBA
ADDIU	SP,SP,FF68
SDC1	F20,0040 (SP)
MTC1	A3,F20		;F20=A3: ypos
SW	RA,0094 (SP)
SW	S8,0090 (SP)
SW	S7,008C (SP)
SW	S6,0088 (SP)
SW	S5,0084 (SP)
SW	S4,0080 (SP)
SW	S3,007C (SP)
SW	S2,0078 (SP)
SW	S1,0074 (SP)
SW	S0,0070 (SP)
SDC1	F30,0068 (SP)
SDC1	F28,0060 (SP)
SDC1	F26,0058 (SP)
SDC1	F24,0050 (SP)
SDC1	F22,0048 (SP)
SW	A1,009C (SP)	;SP+9C=A1: p->manager
SW	A2,00A0 (SP)	;SP+A0=A2: xpos
LUI	AT,4140
MTC1	AT,F30		;F30=12.0	[41400000]
LW	T6,002C (A0)
LUI	AT,4180
MTC1	AT,F28		;F28= 16.0	[41800000]
LUI	V0,0001
LUI	AT,42F0
MTC1	AT,F26		;F26= 120.0	[42F00000]
ADDU	V0,V0,T6
LW	V0,06E4 (V0)	;V0=V0+6E4: p->mail.controller
LUI	AT,4320
MTC1	AT,F24		;F24= 160.0	[43200000]
LUI	AT,3F80
MTC1	AT,F22		;F22=1.0	[3F800000]
OR	S6,R0,R0	;S6=0	init.count.row
LW	S8,00AC (SP)	;S8=[SP+14 f/caller]: p->xend
LW	S7,00B4 (SP)	;S7=[SP+1C f/caller]: rgba
LW	S3,00A8 (SP)	;S3=[SP+10 f/caller]: p->ypos
ADDIU	S2,R0,00CD	;S2=0xCD: '\n'
LW	V1,00B0 (SP)	;V1=[SP+14 f/caller]: p->yend
ADDIU	S5,V0,003C	;S5=mail+3C: p->text
LBU	S1,0006 (V0)	;S1=mail+6: text.len
//80889B44:	loop to display each line
OR	S4,R0,R0	;S4=0: init newline flag
BLEZ	S1,80889B88	;skip parsing if no message to parse!
OR	S0,R0,R0	;S0=0: init count.str
ADDU	V0,S5,R0	;V0=S5: p->text
//80889B54:	test for newlines
LBU	T7,0000 (V0)	;T7=text+0: char from text
BNEL	S2,T7,80889B70	;branch if not '\n'
ADDIU	S0,S0,0001
ADDIU	S0,S0,0001	;S0++	count.str+1
BEQ	R0,R0,80889B88
ADDIU	S4,R0,0001	;S4=TRUE	newline found
//80889B6C:	test for line wrap
ADDIU	S0,S0,0001	;S0++	count.str+1
SLTI	AT,S0,0010
BEQ	AT,R0,80889B88	;branch if overran row (string over 16)
ADDIU	V0,V0,0001	;V0++	p->next char in text
SLT	AT,S0,S1
BNEL	AT,R0,80889B58	;loop if not at end of line
LBU	T7,0000 (V0)
//80889B88:	line correction for displaying trailing newlines
BEQL	S0,R0,80889C7C	;branch if NULL count.str
LWC1	F4,0000 (S3)
BEQ	S4,R0,80889BB0	;branch if newline not found
LW	T8,009C (SP)
LW	T9,0004 (T8)	;T9=T8+4: type flag
ADDIU	AT,R0,0001
BEQL	T9,AT,80889BB4	;branch if type 1: display '\r' symbols
OR	A2,S0,R0
BEQ	R0,R0,80889BB4
ADDIU	A2,S0,FFFF	;A2=count.str-1
//80889BB0:	no correction required
OR	A2,S0,R0	;A2=S0: count.str
//80889BB4:	display line to screen
BEQL	A2,R0,80889C10	;skip if nothing to print
SUBU	S1,S1,S0
LWC1	F4,0000 (S3)	;F4=S3+0: ypos
MFC1	A3,F20		;A3=F20: xpos
ADDIU	T3,R0,00FF
SWC1	F4,0010 (SP)	;SP+10=F4: ypos
LBU	T0,0000 (S7)	;T0=S7+0: red
LW	A0,00A0 (SP)
OR	A1,S5,R0	;A1=S5: p->text
SW	T0,0014 (SP)	;SP+14=T0: red
LBU	T1,0001 (S7)	;T1=S7+1: green
SW	T1,0018 (SP)	;SP+18=T1: green
LBU	T2,0002 (S7)	;T2=S7+2: blue
SW	R0,0034 (SP)	;SP+34=0
SWC1	F22,0030 (SP)	;SP+30=1.0
SWC1	F22,002C (SP)	;SP+2C=1.0
SW	R0,0028 (SP)	;SP+28=0
SW	R0,0024 (SP)	;SP+24=0
SW	T3,0020 (SP)	;SP+20=FF: alpha
JAL	80090E98	;print text to screen
SW	T2,001C (SP)	;SP+1C=T2: blue
LW	V1,00B0 (SP)	;V1=[SP+14 f/caller]: p->yend
//80889C0C:	compute {x,y} at end of message
SUBU	S1,S1,S0	;S1-=S0: text.len-count.str
BNE	S1,R0,80889C78	;branch if more message remains
ADDU	S5,S5,S0	;S5+=S0: p->next char in message
ADDIU	AT,R0,0005
LWC1	F16,0000 (S3)	;F16=S3+0: ypos
BEQL	S6,AT,80889C50	;branch if on final row
SUBU	A0,S5,S0
BNE	S4,R0,80889C38	;branch if count.newline not zero
ADDIU	AT,R0,0010
BNEL	S0,AT,80889C50	;branch if count.str isn't max for line
SUBU	A0,S5,S0
//80889C38:	save final {x,y} position when newline pushes to next row
SUB.S	F6,F20,F24	;F6=xpos - 160.0: lrx-position
SWC1	F6,0000 (S8)	;F6->S8+0: save xend
ADD.S	F10,F16,F28	;F10=ypos+16.0: next line
SUB.S	F16,F26,F10	;F16=120.0 - ypos - 16.0: lry - position
BEQ	R0,R0,80889C78
SWC1	F16,0000 (V1)	;F16->V1+0: save yend
//80889C50:	retrieve width of string and save final {x,y} position
JAL	800902C8	;V0=display width of A1 characters in string A0
OR	A1,R0,S0	;A1=S0: text.len
MTC1	V0,F18
CVT.S.W	F4,F18	;F4=(float) width
LW	V1,00B0 (SP)	;V1=[SP+14 f/caller]: p->yend
SUB.S	F18,F26,F16	;F18=120.0 - ypos: lry-position
ADD.S	F8,F4,F20	;F8=width + xpos
SUB.S	F10,F8,F24	;F10=width + xpos - 160.0: lrx-position
SWC1	F10,0000 (S8)	;F10->S8+0: save xend
SWC1	F18,0000 (V1)	;F18->V1+0: save yend
//80889C78:
LWC1	F4,0000 (S3)	;F4=S3+0: ypos
ADDIU	S6,S6,0001	;S6++	count.row++
ADDIU	AT,R0,0006
ADD.S	F6,F4,F28	;F6= ypos+16.0: next row
BNE	S6,AT,80889B44	;loop for six lines
SWC1	F6,0000 (S3)	;update ypos
//80889C90:	return
LW	RA,0094 (SP)
LDC1	F20,0040 (SP)
LDC1	F22,0048 (SP)
LDC1	F24,0050 (SP)
LDC1	F26,0058 (SP)
LDC1	F28,0060 (SP)
LDC1	F30,0068 (SP)
LW	S0,0070 (SP)
LW	S1,0074 (SP)
LW	S2,0078 (SP)
LW	S3,007C (SP)
LW	S4,0080 (SP)
LW	S5,0084 (SP)
LW	S6,0088 (SP)
LW	S7,008C (SP)
LW	S8,0090 (SP)
JR	RA
ADDIU	SP,SP,0098

80889CD8	E48	print superscript to screen
	accepts: A0=, A1=p->manager, A2=, A3=(float)xpos, SP+10=(float)ypos, SP+14=RGBA
ADDIU	SP,SP,FF80
SDC1	F20,0040 (SP)
MTC1	A3,F20		;F20=xpos
SW	RA,0054 (SP)
SW	S2,0050 (SP)
SW	S1,004C (SP)
SW	S0,0048 (SP)
SW	A1,0084 (SP)	;SP+84=A1: p->manager
LW	T6,002C (A0)
LW	T7,0004 (A2)
LUI	S1,0001
ADDIU	AT,R0,0001
ADDU	S1,S1,T6
BNE	T7,AT,80889E98
LW	S1,06E4 (S1)	;S1=S1+6E4: p->mail.controller
LBU	S2,0003 (S1)	;S2=mail+3: 
ADDIU	S0,S1,002E	;S0=mail+2E: p->super.data
LUI	AT,3F80
MTC1	AT,F0		;F0=1.0	[3F800000]
LWC1	F4,0090 (SP)	;F4=[SP+10 f/caller]: ypos
LW	V0,0094 (SP)	;V0=[SP+14 f/caller]: RGBA
SWC1	F4,0010 (SP)	;SP+10=F4: ypos
LBU	T9,0000 (V0)	;T9=rgba+0: red
SW	T9,0014 (SP)	;SP+14= red
LBU	T9,0001 (V0)	;T9=rgba+1: green
SW	T9,0018 (SP)	;SP+18= green
LBU	T9,0002 (V0)	;T9=rgba+2: blue
SW	T9,001C (SP)	;SP+1C= blue
LBU	T9,0003 (V0)	;T9=rgba+3: alpha
SW	T9,0020 (SP)	;SP+20= alpha
SW	R0,0024 (SP)	;SP+24=0
SW	R0,0028 (SP)	;SP+28=0
SWC1	F0,002C (SP)	;SP+2C=1.0
SWC1	F0,0030 (SP)	;SP+30=1.0
SW	R0,0034 (SP)	;SP+34=0
MFC1	A3,F20		;A3=F20: xpos
LBU	A2,0001 (S0)	;A2=super.data+1: super.len1
ADDIU	A1,S0,0004	;A1=super.data+4: p->super.text
JAL	80090E98	;print text to screen
LW	A0,0084 (SP)	;A0=SP+84: p->manager
ADDIU	A0,S0,0004	;A0=S0+4: p->super.text
JAL	800902C8	;V0=width of A1 chars at A0
LBU	A1,0001 (S0)	;A1=super.data+1: super.len1
LBU	T4,0001 (S0)	;T4=super.data+1: super.len1
LUI	AT,3F80
MTC1	AT,F0		;F0=1.0	[3F800000]
MTC1	V0,F6
LW	A0,0084 (SP)
BGEZ	T4,80889DB0	;branch if valid
CVT.S.W	F8,F6
LUI	AT,4F80
MTC1	AT,F10
NOP
ADD.S	F8,F8,F10
LWC1	F4,0090 (SP)
ADDIU	T5,R0,00B9
ADDIU	T6,R0,00FF
SW	T5,0014 (SP)
SW	R0,0018 (SP)
SW	R0,001C (SP)
SW	T6,0020 (SP)
ADDIU	A1,S1,0008
OR	A2,S2,R0
ADD.S	F20,F20,F8
SW	R0,0024 (SP)
SW	R0,0028 (SP)
SWC1	F0,002C (SP)
SWC1	F0,0030 (SP)
SW	R0,0034 (SP)
MFC1	A3,F20
JAL	80090E98	;print text to screen
SWC1	F4,0010 (SP)
ADDIU	A0,S1,0008
JAL	800902C8	;V0=width of A1 chars at A0
OR	A1,S2,R0
MTC1	V0,F6
LBU	T0,0001 (S0)	;T0=super.data+1: super.len1
LUI	AT,3F80
MTC1	AT,F0
SLTI	AT,T0,000A
BEQ	AT,R0,80889F94
LW	V0,0094 (SP)
LWC1	F18,0090 (SP)
LBU	T7,0005 (S1)
CVT.S.W	F10,F6
SWC1	F18,0010 (SP)
ADDU	A1,S0,T0
LBU	T9,0000 (V0)
SW	T9,0014 (SP)
LBU	T9,0001 (V0)
SW	T9,0018 (SP)
LBU	T9,0002 (V0)
SW	T9,001C (SP)
LBU	T9,0003 (V0)
SW	T9,0020 (SP)
ADDIU	A1,A1,0004
ADD.S	F20,F20,F10
SW	R0,0024 (SP)
SW	R0,0028 (SP)
SWC1	F0,002C (SP)
SWC1	F0,0030 (SP)
SW	R0,0034 (SP)
MFC1	A3,F20
LW	A0,0084 (SP)
JAL	80090E98	;print text to screen
SUBU	A2,T7,T0
BEQ	R0,R0,80889F98
LW	RA,0054 (SP)
NOP
NOP
NOP
NOP
ADDIU	S0,S1,002E
LBU	V0,0002 (S0)
ADDIU	AT,R0,0002
ADDIU	A1,S0,0004
BEQ	V0,AT,80889EC4
ADDIU	A0,SP,0068
ADDIU	AT,R0,0003
BEQ	V0,AT,80889EC4
ADDIU	AT,R0,0005
BNEL	V0,AT,80889ED8
ADDIU	A0,SP,0068
JAL	800998C0	;copy A2 bytes from A1 to A0
ADDIU	A2,R0,000A
BEQ	R0,R0,80889F38
ADDIU	S2,R0,000A
ADDIU	A0,SP,0068
ADDIU	A1,S0,0004
JAL	800998C0	;copy A2 bytes from A1 to A0
LBU	A2,0001 (S0)
LBU	T3,0001 (S0)
ADDIU	T4,SP,0068
ADDIU	A1,S1,0008
LBU	A2,0003 (S1)
JAL	800998C0	;copy A2 bytes from A1 to A0
ADDU	A0,T3,T4
LBU	T0,0001 (S0)
ADDIU	T7,SP,0068
SLTI	AT,T0,000A
BEQ	AT,R0,80889F2C
ADDU	A1,S0,T0
LBU	T5,0003 (S1)
LBU	T8,0005 (S1)
ADDIU	A1,A1,0004
ADDU	T6,T5,T0
ADDU	A0,T6,T7
JAL	800998C0	;copy A2 bytes from A1 to A0
SUBU	A2,T8,T0
LBU	T9,0005 (S1)
LBU	T1,0003 (S1)
ADDU	S2,T9,T1
LWC1	F4,0090 (SP)
LW	V0,0094 (SP)
LUI	AT,3F80
SWC1	F4,0010 (SP)
LBU	T2,0000 (V0)
MTC1	AT,F0
MFC1	A3,F20
SW	T2,0014 (SP)
LBU	T3,0001 (V0)
ADDIU	T5,R0,00FF
LW	A0,0084 (SP)
SW	T3,0018 (SP)
LBU	T4,0002 (V0)
SW	R0,0034 (SP)
SW	R0,0028 (SP)
SW	R0,0024 (SP)
SW	T5,0020 (SP)
ADDIU	A1,SP,0068
OR	A2,S2,R0
SWC1	F0,0030 (SP)
SWC1	F0,002C (SP)
JAL	80090E98	;print text to screen
SW	T4,001C (SP)
LW	RA,0054 (SP)
LDC1	F20,0040 (SP)
LW	S0,0048 (SP)
LW	S1,004C (SP)
LW	S2,0050 (SP)
JR	RA
ADDIU	SP,SP,0080

80889FB0	1120	
ADDIU	SP,SP,FFB0
SW	S1,0028 (SP)
SW	S0,0024 (SP)
OR	S0,A0,R0
OR	S1,A1,R0	;S1=A1: p->manager
SW	RA,002C (SP)
SW	A2,0058 (SP)
SW	A3,005C (SP)
LW	T6,002C (S0)
LUI	AT,4210
MTC1	AT,F4
LUI	T7,0001
LUI	AT,4280
ADDU	T7,T7,T6
LW	T7,06E4 (T7)	;T7=T7+6E4: p->mail.controller
MTC1	AT,F10
LWC1	F16,005C (SP)
LWC1	F6,0060 (SP)
LBU	V0,0031 (T7)	;V0=controller+31: stationary
ADD.S	F0,F10,F16
LUI	T9,8089
ADDIU	T9,T9,AAA4
SUB.S	F8,F4,F6
SLL	T8,V0,0x2
ADDU	V1,T8,T9	;V1=8088AAA4+offset: RGBA
MFC1	A3,F0		;A3=F0: xpos
SWC1	F8,0040 (SP)	;SP+40=F8: ypos
SW	V1,0014 (SP)	;SP+14=V1: RGBA
SW	V1,0034 (SP)	;SP+34=V1: RGBA
SWC1	F8,0010 (SP)	;SP+10=F8: ypos
SWC1	F0,0030 (SP)
OR	A0,S0,R0	;A0=S0: 
OR	A1,S1,R0	;A1=S1: p->manager
JAL	80889CD8	;print superscript to screen
LW	A2,0058 (SP)	;A2=SP+58: 
LUI	AT,41E0
MTC1	AT,F18
LWC1	F2,0040 (SP)
LUI	AT,4320
MTC1	AT,F4
ADD.S	F2,F2,F18
LUI	AT,42F0
LWC1	F0,0030 (SP)
MTC1	AT,F10
LW	T3,0034 (SP)	;T3=SP+34: RGBA
SUB.S	F6,F0,F4
ADDIU	T0,SP,0040
ADDIU	T1,SP,003C
SUB.S	F16,F10,F2
ADDIU	T2,SP,0038
MFC1	A3,F0		;A3=F0: xpos
SWC1	F6,003C (SP)
SWC1	F16,0038 (SP)
SW	T2,0018 (SP)	;SP+18=T2: @yend
SW	T1,0014 (SP)	;SP+14=T1: @xend
SW	T0,0010 (SP)	;SP+10=T0: @ypos
SWC1	F2,0040 (SP)
OR	A0,S0,R0	;A0=S0: 
LW	A1,0058 (SP)	;A1=SP+58: 
OR	A2,S1,R0	;A2=S1: p->manager
JAL	80889A9C	;display mail message body
SW	T3,001C (SP)	;SP+1C=T3: RGBA
LUI	AT,4140
LWC1	F2,0040 (SP)	;F2=SP+40: ypos
MTC1	AT,F8
LWC1	F0,0030 (SP)	;F0=SP+30: xpos
LW	T4,0034 (SP)	;T4=SP+34: RGBA
ADD.S	F2,F2,F8
MFC1	A2,F0		;A2=F0: xpos
OR	A0,S0,R0	;A0=S0: 
OR	A1,S1,R0	;A1=S1: p->manager
MFC1	A3,F2		;A3=F2: ypos
SWC1	F2,0040 (SP)
JAL	808899E4	;displays postscript to screen
SW	T4,0010 (SP)	;SP+10= RGBA
LW	T5,0058 (SP)
ADDIU	AT,R0,0001
LW	T6,0004 (T5)
BNEL	T6,AT,8088A14C
LW	RA,002C (SP)
LW	T7,002C (S0)
LUI	T8,0001
OR	A0,S0,R0
ADDU	T8,T8,T7
LW	T8,06E0 (T8)	;T8=T8+6E0: p->type.controller
OR	A1,S1,R0	;A1=S1: p->manager
LW	A2,005C (SP)
BEQL	T8,R0,8088A14C	;skip if type dialog isn't present
LW	RA,002C (SP)
//8088A114:	handle type dialog
JAL	80889878	;sets cursor position for letter editting
LW	A3,0060 (SP)
LW	T9,002C (S0)
LUI	T0,0001
OR	A0,S0,R0
ADDU	T0,T0,T9
LW	T0,06E0 (T0)	;T0=T0+6E0: p->type.controller
OR	A1,S1,R0	;A1=S1: p->manager
LW	A2,003C (SP)
LW	T9,0028 (T0)
LW	A3,0038 (SP)
JALR	RA,T9
NOP
//8088A148:	return
LW	RA,002C (SP)
LW	S0,0024 (SP)
LW	S1,0028 (SP)
JR	RA
ADDIU	SP,SP,0050

8088A15C	12CC	
ADDIU	SP,SP,FFC8
SW	S0,0020 (SP)
OR	S0,A2,R0
SW	RA,0024 (SP)
SW	A0,0038 (SP)
SW	A1,003C (SP)
LW	T7,0038 (SP)
LW	T6,003C (SP)
LUI	T9,0001
LW	T8,002C (T7)
LWC1	F0,0018 (S0)
LWC1	F2,001C (S0)
ADDU	T9,T9,T8
LW	T9,06E4 (T9)
LW	A0,0000 (T6)
MFC1	A2,F0
MFC1	A3,F2
OR	A1,S0,R0
SWC1	F0,0030 (SP)
SWC1	F2,002C (SP)
SW	T9,0010 (SP)
JAL	80889574
SW	A0,0034 (SP)
LW	T0,0038 (S0)
ADDIU	AT,R0,0001
LUI	V0,0001
BEQ	T0,AT,8088A1E8
LW	A0,0034 (SP)
LW	T1,0038 (SP)
LW	T2,002C (T1)
ADDU	T3,T2,V0
LW	T4,06E4 (T3)
LBU	T5,0004 (T4)
BNEL	T5,R0,8088A220
LW	RA,0024 (SP)
LW	T6,0038 (SP)
LW	T7,002C (T6)
ADDU	T8,T7,V0
LW	T9,06B4 (T8)
JALR	RA,T9
NOP
LWC1	F4,002C (SP)
LW	A0,0038 (SP)
LW	A1,003C (SP)
OR	A2,S0,R0
LW	A3,0030 (SP)
JAL	80889FB0
SWC1	F4,0010 (SP)
LW	RA,0024 (SP)
LW	S0,0020 (SP)
ADDIU	SP,SP,0038
JR	RA
NOP

8088A230	13A0	
ADDIU	SP,SP,FFE0
SW	RA,0014 (SP)
SW	A1,0024 (SP)
LW	A2,002C (A0)
LUI	AT,0001
ORI	AT,AT,03E8
ADDU	A2,A2,AT
SW	A2,001C (SP)
SW	A0,0020 (SP)
LW	T9,0010 (A2)
LW	A1,0024 (SP)
JALR	RA,T9
NOP
LW	A0,0020 (SP)
LUI	T7,0001
LW	A2,001C (SP)
LW	T6,002C (A0)
ADDU	T7,T7,T6
LW	T7,06E4 (T7)
LW	T8,00B8 (T7)
BEQL	T8,R0,8088A294
LW	RA,0014 (SP)
JAL	8088A15C
LW	A1,0024 (SP)
LW	RA,0014 (SP)
ADDIU	SP,SP,0020
JR	RA
NOP

8088A2A0	1410	
LW	V0,002C (A0)
LUI	AT,0001
ORI	AT,AT,0670
LUI	T6,8089
LUI	T7,8089
ADDU	V0,V0,AT
ADDIU	T6,T6,9514	;T6=80889514
ADDIU	T7,T7,A230	;T7=8088A230
SW	T6,0000 (V0)
SW	T7,0004 (V0)
JR	RA
NOP

8088A2D0	1440	
ADDIU	SP,SP,FFA0
SW	RA,0024 (SP)
SW	S0,0020 (SP)
SW	A0,0060 (SP)
ADDIU	T0,R0,0001
LW	T6,0060 (SP)
LUI	AT,0001
LUI	S0,0001
LW	V0,002C (T6)
ORI	AT,AT,03E8
ADDIU	T7,R0,0005
ADDU	S0,S0,V0
LW	S0,06E4 (S0)	;S0=S0+6E4: p->mail.controller
ADDU	V1,V0,AT
LUI	AT,0001
ADDU	AT,AT,V0
SW	R0,06A0 (AT)
SW	R0,0004 (V1)
SW	T7,0034 (V1)
ADDIU	T8,R0,0002
SB	T0,0000 (S0)	;1->mail+0: 
SB	T8,0001 (S0)	;2->mail+1: 
SB	R0,0002 (S0)	;0->mail+2: 
LW	T9,0040 (V1)
ADDIU	A0,S0,0008	;A0=mail+8: 
SW	T9,00AC (S0)
LW	T2,0038 (V1)
BNE	T2,R0,8088A474
ADDIU	T1,R0,0001
LUI	T3,8013
LW	T3,6FD8 (T3)	;T3=80136FD8: 
ADDIU	V0,S0,003C
ADDIU	A1,R0,000D
ADDIU	T4,T3,03EE
SW	T4,0054 (SP)
SB	T0,0004 (S0)	;1->mail+4: 
SW	T1,0030 (V1)
SW	V1,005C (SP)
SW	V0,0030 (SP)
SW	V0,0010 (SP)
LW	A0,0060 (SP)
OR	A2,R0,R0
JAL	800C4DB0
OR	A3,R0,R0
LUI	A1,8013
LW	A1,6FD8 (A1)	;A1=80136FD8: 
JAL	8009C4F4
ADDIU	A0,S0,0008	;A0=mail+8: 
LW	V1,005C (SP)
LUI	A3,8013
ADDIU	A3,A3,6EA0	;A3=80136EA0
LW	T6,003C (V1)
LW	T5,0138 (A3)
LW	V0,0054 (SP)
SLL	T7,T6,0x1
ADDU	T8,T5,T7
LHU	T9,0014 (T8)
ADDIU	AT,R0,FFFF
ADDIU	A0,S0,0032	;A0=mail+32: 
ADDIU	T3,T9,E000	;T3=T9-0x2000: stationary ID->index
SB	T3,0031 (S0)	;T3->mail+31: stationary
LB	T4,0000 (V0)
ADDIU	A2,R0,000A
ADDIU	A1,V0,0002
BNE	T4,AT,8088A440
NOP
LW	A0,0138 (A3)	;A0=A3+138: p->string
ADDIU	A1,R0,0006	;A1=6: strlen
JAL	8009C1C0	;V0=actual strlen
ADDIU	A2,R0,0020	;A2=' ': fill char
ADDIU	A0,S0,0032	;A0=mail+32: 
LUI	A1,8089
SW	V0,0050 (SP)
ADDIU	A1,A1,ABB8	;A1=8088ABB8(hacked): default superscript
SW	A0,002C (SP)
JAL	800998C0	;copy A2 bytes from A1 to A0
ADDIU	A2,R0,0006
ADDIU	A0,S0,009C	;A0=mail+9C: 
LUI	A1,8089
ADDIU	A1,A1,ABEC	;A1=8088ABEC: default postscript
SW	A0,0028 (SP)
JAL	800998C0	;copy A2 bytes from A1 to A0
ADDIU	A2,R0,0009
LUI	A1,8013
LW	A1,6FD8 (A1)	;A1=80136FD8: 
ADDIU	A0,S0,00A5	;A0=mail+A5: 
JAL	800998C0	;copy A2 bytes from A1 to A0
LW	A2,0050 (SP)
ADDIU	AT,R0,0005
BEQ	R0,R0,8088A4F4
SB	AT,002F (S0)	;5->mail+2F: 
NOP
JAL	800998C0	;copy A2 bytes from A1 to A0
SW	A0,002C (SP)
LW	A1,0054 (SP)
ADDIU	A0,S0,009C	;A0=mail+9C: 
SW	A0,0028 (SP)
ADDIU	A2,R0,0010
JAL	800998C0	;copy A2 bytes from A1 to A0
ADDIU	A1,A1,000C
LW	T5,0054 (SP)
LB	T7,0000 (T5)
SB	T7,002F (S0)	;T7->mail+2F: 
BEQ	R0,R0,8088A4F8
LW	A0,002C (SP)
LW	A1,0040 (V1)
SW	A0,002C (SP)
JAL	8009C67C	;copy 0xA4 bytes from A1 to A0
SW	V1,005C (SP)
LW	V1,005C (SP)
ADDIU	T1,R0,0001
OR	A2,T1,R0
LW	T8,0038 (V1)
ADDIU	A1,R0,000D
OR	A3,R0,R0
BNE	T1,T8,8088A4B8
ADDIU	T3,S0,003C	;T3=mail+3C: p->text
ADDIU	T9,R0,0002
SW	T9,0030 (V1)
ADDIU	T2,S0,003C	;T2=mail+3C: p->text
BEQ	R0,R0,8088A4CC
SW	T2,0030 (SP)
SW	T1,0030 (V1)
SW	T3,0010 (SP)
SW	T3,0030 (SP)
JAL	800C4DB0
LW	A0,0060 (SP)
SB	R0,0004 (S0)	;0->mail+4: 
LW	A0,002C (SP)	;A0=SP+2C: p->string
ADDIU	A1,R0,0006	;A1=6: strlen
JAL	8009C1C0	;V0=actual strlen
ADDIU	A2,R0,0020	;A2=' ': fill char
SB	V0,0003 (S0)	;strlen->mail+3: 
ADDIU	T6,S0,0032	;T6=mail+32: superscript.text
ADDIU	T5,S0,009C	;T5=mail+9C: postscript.text
SW	T5,0028 (SP)	;SP+28= p->postscript.text
SW	T6,002C (SP)	;SP+2C= p->superscript.text
LW	A0,002C (SP)	;A0=p->superscript.text
ADDIU	A1,R0,000A
JAL	8009C1C0	;V0=actual strlen
ADDIU	A2,R0,0020
SB	V0,0005 (S0)	;strlen->mail+5: superscript.len
LW	A0,0028 (SP)	;A0=p->postscript.text
ADDIU	A1,R0,0010
JAL	8009C1C0	;V0=actual strlen
ADDIU	A2,R0,0020
SB	V0,0007 (S0)	;strlen->mail+7: postscript.len
LW	A0,0030 (SP)	;A0=SP+30: p->message.text
ADDIU	A1,R0,0060
JAL	8009C1C0	;V0=actual strlen
ADDIU	A2,R0,0020
LBU	V1,002F (S0)	;V1=mail+2F: superscript.name
SB	V0,0006 (S0)	;strlen->mail+6: message.len
ADDIU	T7,R0,000A
SLTI	AT,V1,000B
BNE	AT,R0,8088A550	;branch if name not within superscript
OR	A0,V1,R0
ANDI	V1,T7,00FF	;V1=0xA: place name at end
OR	A0,V1,R0	;A0=V1: superscript.name
SB	T7,002F (S0)	;A->mail+2F: set at end by default
LBU	T8,0005 (S0)	;T8=mail+5: superscript.len
ADDIU	A2,R0,0010
SLT	AT,T8,A0
BEQ	AT,R0,8088A568
ADDIU	A0,SP,0034
SB	V1,0005 (S0)	;V1->mail+5: 
LBU	T9,0007 (S0)	;T9=mail+7: postscript.len
MTC1	R0,F18
LUI	AT,4298
MTC1	AT,F16
SWC1	F18,00B0 (S0)	;0->mail+B0: 
BEQ	T9,R0,8088A5F0
SWC1	F16,00B4 (S0)	;F16->mail+B4: 
LW	A1,0028 (SP)
JAL	800998C0	;copy A2 bytes from A1 to A0
SW	A0,0048 (SP)
LBU	V1,0007 (S0)	;V1=mail+7: 
LW	A3,0048 (SP)
OR	V0,R0,R0
BLEZ	V1,8088A5C4
ADDIU	A1,R0,0010
ADDIU	A0,R0,0020
LBU	T2,0000 (A3)
BNEL	A0,T2,8088A5C8
LW	A0,0028 (SP)
ADDIU	V0,V0,0001
SLT	AT,V0,V1
BNE	AT,R0,8088A5A8
ADDIU	A3,A3,0001
LW	A0,0028 (SP)
ADDIU	A2,R0,0020
SW	V0,004C (SP)
JAL	8009992C	;memset(A0,A1,A2)
SW	A3,0048 (SP)
LW	V0,004C (SP)
LBU	T3,0007 (S0)	;T3=mail+7: 
LW	A1,0048 (SP)
LW	A0,0028 (SP)
JAL	800998C0	;copy A2 bytes from A1 to A0
SUBU	A2,T3,V0
LW	RA,0024 (SP)
LW	S0,0020 (SP)
ADDIU	SP,SP,0060
JR	RA
NOP

8088A604	1774	load stationary display list
	accepts: A0=
ADDIU	SP,SP,FFD0
LUI	T1,8089
ADDIU	T1,T1,A9A0
SW	RA,001C (SP)
LUI	A1,0001
LW	T6,002C (A0)
LUI	T4,00AE
LUI	A3,8089
ADDU	T7,T6,A1
LW	V0,06E4 (T7)	;V0=T7+6E4: p->mail.controller
ADDIU	A3,A3,ABD0	;A3=8088ABD0
ADDIU	T4,T4,3000	;T4=AE3000: base codeword
LBU	T0,0031 (V0)	;T0=controller+31: stationary
LW	T3,00B8 (V0)
SLL	T8,T0,0x2
ADDU	T9,T1,T8
LW	T2,0000 (T9)	;T2=8088A9A0+offset: stationary DL offsets
SW	T2,00BC (V0)	;DL.offset->controller+BC
BNE	T3,R0,8088A68C
SW	T3,0024 (SP)
LW	T5,002C (A0)
LUI	AT,0001
ADDU	T6,T5,A1
LW	T7,0000 (T6)
SW	T7,00B8 (V0)
LW	V1,002C (A0)
ADDU	T8,V1,A1
LW	T9,0000 (T8)
ADDU	AT,AT,V1
ADDIU	T2,T9,1400
SW	T2,0000 (AT)
LW	T3,00B8 (V0)
LBU	T0,0031 (V0)	;T0=controller+31: stationary
SW	T3,0024 (SP)
LW	V1,00BC (V0)	;V1=controller+BC: DL.offset
SLL	T7,T0,0x2
ADDU	T8,T1,T7
LW	T9,0004 (T8)	;T9=8088A9A4+offset: stationary DL endpoints
LUI	T6,0C00
ADDIU	T6,T6,0000
ADDIU	T2,R0,04CC
ADDU	T5,V1,T4	;T5=V1+AE3000: offset + base
SUBU	A1,T5,T6	;A1=offset + base - 0xC000000: codeword
SW	T2,0010 (SP)	;0x4CC->SP+10: unused debug value
SW	V0,002C (SP)
LW	A0,0024 (SP)	;A0=SP+24: p->target
JAL	80026E10	;retrieves data from ROM with codeword
SUBU	A2,T9,V1	;A2=T9-V1: end - start: size
LW	V0,002C (SP)
LUI	T4,0C00
ADDIU	T4,T4,0000
LW	T3,00BC (V0)	;T3=controller+BC: DL.offset
SUBU	T5,T3,T4	;T5=T3-0xC000000: convert to offset
SW	T5,00BC (V0)	;update DL.offset
LW	RA,001C (SP)
JR	RA
ADDIU	SP,SP,0030

8088A6E8	1858	
ADDIU	SP,SP,FFD8
SW	S0,0018 (SP)
OR	S0,A0,R0
SW	RA,001C (SP)
LUI	A3,0001
LW	V1,002C (S0)
LUI	AT,0001
ORI	AT,AT,0410
ADDU	T6,V1,A3
LW	T7,06E4 (T6)	;T7=T6+6E4: p->mail.controller
OR	A0,S0,R0
ADDU	T8,V1,A3
BNE	T7,R0,8088A750	;branch if mail.controller already initialized
NOP
SW	V1,0024 (SP)
LW	T9,06CC (T8)
LUI	A2,8089
ADDIU	A2,A2,ABC0	;A2=8088ABC0
JALR	RA,T9
ADDU	A1,V1,AT
LW	V0,0024 (SP)
LUI	T0,8089
LUI	AT,0001
ADDIU	T0,T0,AC00
ADDU	AT,AT,V0
SW	T0,06E4 (AT)	;8088AC00->AT+6E4: set p->mail.controller
//8088A750:
JAL	8088A2D0
OR	A0,S0,R0
JAL	8088A2A0
OR	A0,S0,R0
JAL	8088A604	;load stationary display list
OR	A0,S0,R0
//8088A768:	return
LW	RA,001C (SP)
LW	S0,0018 (SP)
ADDIU	SP,SP,0028
JR	RA
NOP

8088A77C	18EC	release (NULL) mail controller
LW	T6,002C (A0)
LUI	AT,0001
ADDU	AT,AT,T6
SW	R0,06E4 (AT)	;NULLify p->mail.controller
JR	RA
NOP
